
// Copyright (C) 2009-2011 Luca Piccioni
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;

#pragma warning disable 1572, 1573

namespace Derm.OpenGL {

	/// <summary>
	/// Implementation of the OpenGL specification 
	/// </summary>
	public unsafe partial class Wgl : ProcLoader
	{

		/// <summary>
		/// Binding for wglBindDisplayColorTableEXT function.
		/// </summary>
		/// <param name="id">
		/// A <see cref="T:System.UInt16"/>.
		/// </param>
		public static bool BindDisplayColorTableEXT(UInt16 id) {
			bool retvalue;
			if      (Delegates.pwglBindDisplayColorTableEXT != null)
				retvalue = (Delegates.pwglBindDisplayColorTableEXT(id));
			else
				throw new InvalidOperationException("binding point BindDisplayColorTableEXT cannot be found");
			LogProc("wglBindDisplayColorTableEXT({0}) = {1}", id, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglChoosePixelFormatEXT function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="piAttribIList">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		/// <param name="pfAttribFList">
		/// A <see cref="T:System.Single*"/>.
		/// </param>
		/// <param name="nMaxFormats">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="piFormats">
		/// A <see cref="T:System.Int32*"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="nNumFormats">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean ChoosePixelFormatEXT(IntPtr hdc, int[] piAttribIList, Single[] pfAttribFList, UInt32 nMaxFormats, [Out] int[] piFormats, [Out] out UInt32 nNumFormats) {
			Boolean retvalue;
			unsafe {
				fixed (int* fp_piAttribIList = piAttribIList)
				fixed (Single* fp_pfAttribFList = pfAttribFList)
				fixed (int* fp_piFormats = piFormats)
				fixed (UInt32* fp_nNumFormats = &nNumFormats)
				{
					if      (Delegates.pwglChoosePixelFormatEXT != null)
						retvalue = (Delegates.pwglChoosePixelFormatEXT(hdc, fp_piAttribIList, fp_pfAttribFList, nMaxFormats, fp_piFormats, fp_nNumFormats));
					else
						throw new InvalidOperationException("binding point ChoosePixelFormatEXT cannot be found");
				}
			}
			LogProc("wglChoosePixelFormatEXT({0}, {1}, {2}, {3}, {4}, {5}) = {6}", hdc, piAttribIList, pfAttribFList, nMaxFormats, piFormats, nNumFormats, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglCreateDisplayColorTableEXT function.
		/// </summary>
		/// <param name="id">
		/// A <see cref="T:System.UInt16"/>.
		/// </param>
		public static bool CreateDisplayColorTableEXT(UInt16 id) {
			bool retvalue;
			if      (Delegates.pwglCreateDisplayColorTableEXT != null)
				retvalue = (Delegates.pwglCreateDisplayColorTableEXT(id));
			else
				throw new InvalidOperationException("binding point CreateDisplayColorTableEXT cannot be found");
			LogProc("wglCreateDisplayColorTableEXT({0}) = {1}", id, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglCreatePbufferEXT function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iPixelFormat">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="iWidth">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="iHeight">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="piAttribList">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		public static IntPtr CreatePbufferEXT(IntPtr hDC, int iPixelFormat, int iWidth, int iHeight, int[] piAttribList) {
			IntPtr retvalue;
			unsafe {
				fixed (int* fp_piAttribList = piAttribList)
				{
					if      (Delegates.pwglCreatePbufferEXT != null)
						retvalue = (Delegates.pwglCreatePbufferEXT(hDC, iPixelFormat, iWidth, iHeight, fp_piAttribList));
					else
						throw new InvalidOperationException("binding point CreatePbufferEXT cannot be found");
				}
			}
			LogProc("wglCreatePbufferEXT({0}, {1}, {2}, {3}, {4}) = {5}", hDC, iPixelFormat, iWidth, iHeight, piAttribList, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglDestroyDisplayColorTableEXT function.
		/// </summary>
		/// <param name="id">
		/// A <see cref="T:System.UInt16"/>.
		/// </param>
		public static void DestroyDisplayColorTableEXT(UInt16 id) {
			if      (Delegates.pwglDestroyDisplayColorTableEXT != null)
				Delegates.pwglDestroyDisplayColorTableEXT(id);
			else
				throw new InvalidOperationException("binding point DestroyDisplayColorTableEXT cannot be found");
			LogProc("wglDestroyDisplayColorTableEXT({0})", id);
		}

		/// <summary>
		/// Binding for wglDestroyPbufferEXT function.
		/// </summary>
		/// <param name="hPbuffer">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean DestroyPbufferEXT(IntPtr hPbuffer) {
			Boolean retvalue;
			if      (Delegates.pwglDestroyPbufferEXT != null)
				retvalue = (Delegates.pwglDestroyPbufferEXT(hPbuffer));
			else
				throw new InvalidOperationException("binding point DestroyPbufferEXT cannot be found");
			LogProc("wglDestroyPbufferEXT({0}) = {1}", hPbuffer, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetCurrentReadDCEXT function.
		/// </summary>
		public static IntPtr GetCurrentReadDCEXT() {
			IntPtr retvalue;
			if      (Delegates.pwglGetCurrentReadDCEXT != null)
				retvalue = (Delegates.pwglGetCurrentReadDCEXT());
			else
				throw new InvalidOperationException("binding point GetCurrentReadDCEXT cannot be found");
			LogProc("wglGetCurrentReadDCEXT()");
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetExtensionsStringEXT function.
		/// </summary>
		public static string GetExtensionsStringEXT() {
			string retvalue;
			if      (Delegates.pwglGetExtensionsStringEXT != null)
				retvalue = (Delegates.pwglGetExtensionsStringEXT());
			else
				throw new InvalidOperationException("binding point GetExtensionsStringEXT cannot be found");
			LogProc("wglGetExtensionsStringEXT()");
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetPbufferDCEXT function.
		/// </summary>
		/// <param name="hPbuffer">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static IntPtr GetPbufferDCEXT(IntPtr hPbuffer) {
			IntPtr retvalue;
			if      (Delegates.pwglGetPbufferDCEXT != null)
				retvalue = (Delegates.pwglGetPbufferDCEXT(hPbuffer));
			else
				throw new InvalidOperationException("binding point GetPbufferDCEXT cannot be found");
			LogProc("wglGetPbufferDCEXT({0}) = {1}", hPbuffer, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetPixelFormatAttribfvEXT function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iPixelFormat">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="iLayerPlane">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="nAttributes">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="piAttributes">
		/// A <see cref="T:System.Int32*"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="pfValues">
		/// A <see cref="T:System.Single*"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean GetPixelFormatAttribEXT(IntPtr hdc, int iPixelFormat, int iLayerPlane, UInt32 nAttributes, [Out] int[] piAttributes, [Out] Single[] pfValues) {
			Boolean retvalue;
			unsafe {
				fixed (int* fp_piAttributes = piAttributes)
				fixed (Single* fp_pfValues = pfValues)
				{
					if      (Delegates.pwglGetPixelFormatAttribfvEXT != null)
						retvalue = (Delegates.pwglGetPixelFormatAttribfvEXT(hdc, iPixelFormat, iLayerPlane, nAttributes, fp_piAttributes, fp_pfValues));
					else
						throw new InvalidOperationException("binding point GetPixelFormatAttribEXT cannot be found");
				}
			}
			LogProc("wglGetPixelFormatAttribfvEXT({0}, {1}, {2}, {3}, {4}, {5}) = {6}", hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetPixelFormatAttribivEXT function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iPixelFormat">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="iLayerPlane">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="nAttributes">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="piAttributes">
		/// A <see cref="T:System.Int32*"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="piValues">
		/// A <see cref="T:System.Int32*"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean GetPixelFormatAttribEXT(IntPtr hdc, int iPixelFormat, int iLayerPlane, UInt32 nAttributes, [Out] int[] piAttributes, [Out] int[] piValues) {
			Boolean retvalue;
			unsafe {
				fixed (int* fp_piAttributes = piAttributes)
				fixed (int* fp_piValues = piValues)
				{
					if      (Delegates.pwglGetPixelFormatAttribivEXT != null)
						retvalue = (Delegates.pwglGetPixelFormatAttribivEXT(hdc, iPixelFormat, iLayerPlane, nAttributes, fp_piAttributes, fp_piValues));
					else
						throw new InvalidOperationException("binding point GetPixelFormatAttribEXT cannot be found");
				}
			}
			LogProc("wglGetPixelFormatAttribivEXT({0}, {1}, {2}, {3}, {4}, {5}) = {6}", hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, piValues, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetSwapIntervalEXT function.
		/// </summary>
		public static int GetSwapIntervalEXT() {
			int retvalue;
			if      (Delegates.pwglGetSwapIntervalEXT != null)
				retvalue = (Delegates.pwglGetSwapIntervalEXT());
			else
				throw new InvalidOperationException("binding point GetSwapIntervalEXT cannot be found");
			LogProc("wglGetSwapIntervalEXT()");
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglLoadDisplayColorTableEXT function.
		/// </summary>
		/// <param name="table">
		/// A <see cref="T:System.UInt16*"/>.
		/// </param>
		/// <param name="length">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static bool LoadDisplayColorTableEXT(UInt16[] table, UInt32 length) {
			bool retvalue;
			unsafe {
				fixed (UInt16* fp_table = table)
				{
					if      (Delegates.pwglLoadDisplayColorTableEXT != null)
						retvalue = (Delegates.pwglLoadDisplayColorTableEXT(fp_table, length));
					else
						throw new InvalidOperationException("binding point LoadDisplayColorTableEXT cannot be found");
				}
			}
			LogProc("wglLoadDisplayColorTableEXT({0}, {1}) = {2}", table, length, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglMakeContextCurrentEXT function.
		/// </summary>
		/// <param name="hDrawDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="hReadDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="hglrc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean MakeContextCurrentEXT(IntPtr hDrawDC, IntPtr hReadDC, IntPtr hglrc) {
			Boolean retvalue;
			if      (Delegates.pwglMakeContextCurrentEXT != null)
				retvalue = (Delegates.pwglMakeContextCurrentEXT(hDrawDC, hReadDC, hglrc));
			else
				throw new InvalidOperationException("binding point MakeContextCurrentEXT cannot be found");
			LogProc("wglMakeContextCurrentEXT({0}, {1}, {2}) = {3}", hDrawDC, hReadDC, hglrc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglQueryPbufferEXT function.
		/// </summary>
		/// <param name="hPbuffer">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iAttribute">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="piValue">
		/// A <see cref="T:System.Int32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean QueryPbufferEXT(IntPtr hPbuffer, int iAttribute, [Out] out int piValue) {
			Boolean retvalue;
			unsafe {
				fixed (int* fp_piValue = &piValue)
				{
					if      (Delegates.pwglQueryPbufferEXT != null)
						retvalue = (Delegates.pwglQueryPbufferEXT(hPbuffer, iAttribute, fp_piValue));
					else
						throw new InvalidOperationException("binding point QueryPbufferEXT cannot be found");
				}
			}
			LogProc("wglQueryPbufferEXT({0}, {1}, {2}) = {3}", hPbuffer, iAttribute, piValue, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglReleasePbufferDCEXT function.
		/// </summary>
		/// <param name="hPbuffer">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static int ReleasePbufferDCEXT(IntPtr hPbuffer, IntPtr hDC) {
			int retvalue;
			if      (Delegates.pwglReleasePbufferDCEXT != null)
				retvalue = (Delegates.pwglReleasePbufferDCEXT(hPbuffer, hDC));
			else
				throw new InvalidOperationException("binding point ReleasePbufferDCEXT cannot be found");
			LogProc("wglReleasePbufferDCEXT({0}, {1}) = {2}", hPbuffer, hDC, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglSwapIntervalEXT function.
		/// </summary>
		/// <param name="interval">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static Boolean SwapIntervalEXT(int interval) {
			Boolean retvalue;
			if      (Delegates.pwglSwapIntervalEXT != null)
				retvalue = (Delegates.pwglSwapIntervalEXT(interval));
			else
				throw new InvalidOperationException("binding point SwapIntervalEXT cannot be found");
			LogProc("wglSwapIntervalEXT({0}) = {1}", interval, retvalue);
			return (retvalue);
		}

		internal static partial class Delegates
		{
			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate bool wglBindDisplayColorTableEXT(UInt16 id);
			internal static wglBindDisplayColorTableEXT pwglBindDisplayColorTableEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglChoosePixelFormatEXT(IntPtr hdc, int* piAttribIList, Single* pfAttribFList, UInt32 nMaxFormats, [Out] int* piFormats, [Out] UInt32* nNumFormats);
			internal static wglChoosePixelFormatEXT pwglChoosePixelFormatEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate bool wglCreateDisplayColorTableEXT(UInt16 id);
			internal static wglCreateDisplayColorTableEXT pwglCreateDisplayColorTableEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate IntPtr wglCreatePbufferEXT(IntPtr hDC, int iPixelFormat, int iWidth, int iHeight, int* piAttribList);
			internal static wglCreatePbufferEXT pwglCreatePbufferEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void wglDestroyDisplayColorTableEXT(UInt16 id);
			internal static wglDestroyDisplayColorTableEXT pwglDestroyDisplayColorTableEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglDestroyPbufferEXT(IntPtr hPbuffer);
			internal static wglDestroyPbufferEXT pwglDestroyPbufferEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate IntPtr wglGetCurrentReadDCEXT();
			internal static wglGetCurrentReadDCEXT pwglGetCurrentReadDCEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate string wglGetExtensionsStringEXT();
			internal static wglGetExtensionsStringEXT pwglGetExtensionsStringEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate IntPtr wglGetPbufferDCEXT(IntPtr hPbuffer);
			internal static wglGetPbufferDCEXT pwglGetPbufferDCEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglGetPixelFormatAttribfvEXT(IntPtr hdc, int iPixelFormat, int iLayerPlane, UInt32 nAttributes, [Out] int* piAttributes, [Out] Single* pfValues);
			internal static wglGetPixelFormatAttribfvEXT pwglGetPixelFormatAttribfvEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglGetPixelFormatAttribivEXT(IntPtr hdc, int iPixelFormat, int iLayerPlane, UInt32 nAttributes, [Out] int* piAttributes, [Out] int* piValues);
			internal static wglGetPixelFormatAttribivEXT pwglGetPixelFormatAttribivEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate int wglGetSwapIntervalEXT();
			internal static wglGetSwapIntervalEXT pwglGetSwapIntervalEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate bool wglLoadDisplayColorTableEXT(UInt16* table, UInt32 length);
			internal static wglLoadDisplayColorTableEXT pwglLoadDisplayColorTableEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglMakeContextCurrentEXT(IntPtr hDrawDC, IntPtr hReadDC, IntPtr hglrc);
			internal static wglMakeContextCurrentEXT pwglMakeContextCurrentEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglQueryPbufferEXT(IntPtr hPbuffer, int iAttribute, [Out] int* piValue);
			internal static wglQueryPbufferEXT pwglQueryPbufferEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate int wglReleasePbufferDCEXT(IntPtr hPbuffer, IntPtr hDC);
			internal static wglReleasePbufferDCEXT pwglReleasePbufferDCEXT = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglSwapIntervalEXT(int interval);
			internal static wglSwapIntervalEXT pwglSwapIntervalEXT = null;

		}

		internal static partial class Imports
		{
			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglBindDisplayColorTableEXT", ExactSpelling = true)]
			internal extern static bool wglBindDisplayColorTableEXT(UInt16 id);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglChoosePixelFormatEXT", ExactSpelling = true)]
			internal extern static unsafe Boolean wglChoosePixelFormatEXT(IntPtr hdc, int* piAttribIList, Single* pfAttribFList, UInt32 nMaxFormats, [Out]int* piFormats, [Out]UInt32 nNumFormats);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglCreateDisplayColorTableEXT", ExactSpelling = true)]
			internal extern static bool wglCreateDisplayColorTableEXT(UInt16 id);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglCreatePbufferEXT", ExactSpelling = true)]
			internal extern static unsafe IntPtr wglCreatePbufferEXT(IntPtr hDC, int iPixelFormat, int iWidth, int iHeight, int* piAttribList);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglDestroyDisplayColorTableEXT", ExactSpelling = true)]
			internal extern static void wglDestroyDisplayColorTableEXT(UInt16 id);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglDestroyPbufferEXT", ExactSpelling = true)]
			internal extern static Boolean wglDestroyPbufferEXT(IntPtr hPbuffer);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetCurrentReadDCEXT", ExactSpelling = true)]
			internal extern static IntPtr wglGetCurrentReadDCEXT();

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetExtensionsStringEXT", ExactSpelling = true)]
			internal extern static string wglGetExtensionsStringEXT();

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetPbufferDCEXT", ExactSpelling = true)]
			internal extern static IntPtr wglGetPbufferDCEXT(IntPtr hPbuffer);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetPixelFormatAttribfvEXT", ExactSpelling = true)]
			internal extern static unsafe Boolean wglGetPixelFormatAttribfvEXT(IntPtr hdc, int iPixelFormat, int iLayerPlane, UInt32 nAttributes, [Out]int* piAttributes, [Out]Single* pfValues);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetPixelFormatAttribivEXT", ExactSpelling = true)]
			internal extern static unsafe Boolean wglGetPixelFormatAttribivEXT(IntPtr hdc, int iPixelFormat, int iLayerPlane, UInt32 nAttributes, [Out]int* piAttributes, [Out]int* piValues);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetSwapIntervalEXT", ExactSpelling = true)]
			internal extern static int wglGetSwapIntervalEXT();

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglLoadDisplayColorTableEXT", ExactSpelling = true)]
			internal extern static unsafe bool wglLoadDisplayColorTableEXT(UInt16* table, UInt32 length);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglMakeContextCurrentEXT", ExactSpelling = true)]
			internal extern static Boolean wglMakeContextCurrentEXT(IntPtr hDrawDC, IntPtr hReadDC, IntPtr hglrc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglQueryPbufferEXT", ExactSpelling = true)]
			internal extern static unsafe Boolean wglQueryPbufferEXT(IntPtr hPbuffer, int iAttribute, [Out]int piValue);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglReleasePbufferDCEXT", ExactSpelling = true)]
			internal extern static int wglReleasePbufferDCEXT(IntPtr hPbuffer, IntPtr hDC);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglSwapIntervalEXT", ExactSpelling = true)]
			internal extern static Boolean wglSwapIntervalEXT(int interval);

		}

	}
}
